package models

import (
	"github.com/astaxie/beego/orm"
	_ "github.com/go-sql-driver/mysql"
)

func Init() {

	orm.Debug = true
	orm.RegisterDriver("mysql", orm.DRMySQL)
	maxIdle := 30
	maxConn := 30
	orm.RegisterDataBase("default", "mysql", "root:qwe123!@#@tcp(sh-cdb-p9hgpwjr.sql.tencentcdb.com:63422)/litter_sister?charset=utf8", maxIdle, maxConn)

	orm.RegisterModel(new(User), new(Manager), new(ActiveJoinedUser), new(Active), new(Product), new(Order), new(StoreInfo), new(Session), new(Statff))
	orm.RunSyncdb("default", false, true)

	sessionInit()

}
